According to Wikipedia, this nickname "is derived from the popularity of sailing in the region." The link to the New Zealand Herald, which Wikipedia cites as the source of this information, is now dead; but a site called Aucklife ("Everyday Life in Auckland") concurs, describing the city's "iconic location ... on a small land tongue in the center of the Auckland region, locked in by the Tasman Sea in the west and the Hauraki Gulf in the east ... [with] plenty of access to the water. There are several large commercial and container harbours as well as multiple large marinas and yacht harbours within the City. And the latter are responsible for the City of Sails part of the name."
The Auckland Region occupies what is effectively an isthmus, towards the northern tip of New Zealand's North Island. The Hauraki Gulf is an inlet of the Pacific Ocean, while the city's Tasman Sea shore is on Manukau Harbour, which is similarly an inlet. It strikes me as rather odd that Aucklife names the Pacific Ocean inlet but not the Tasman Sea one; but what do I know?
Wikipedia notes that "Auckland is one of the few cities in the world to have a harbour on each of two separate major bodies of water."
© Haydn Thompson 2022